package application;

import application.dao.entity.Manager;
import application.dao.entity.User;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;

import java.net.URL;
import java.util.ResourceBundle;

public class Manager_main_controller extends BaseController implements Initializable {

    public javafx.stage.Stage stage;
    @FXML
    public Label showMobile;
    @FXML
    public Label showIdcard;
    @FXML
    public Label showRealName;
    @FXML
    public Label showUserName;
    @FXML
    private Menu menu_join;

    @FXML
    private Button more_application;

    @FXML
    private MenuItem menu_join_competitons;

    @FXML
    private Menu menu_main;

    @FXML
    private Button more_scores;

    @FXML
    private MenuItem menu_join_users;

    @FXML
    private Button more_announcements;

    @FXML
    private Menu menu_person;

    @FXML
    private Menu menu_informations;

    @FXML
    private Button more_news;

    @FXML
    private Menu menu_scores;

    @FXML
    void onCheckMore_application(ActionEvent event) {

    }

    @FXML
    void onCheckMore_scores(ActionEvent event) {
    }

    @FXML
    void ff8f8f(ActionEvent event) {

    }

    @FXML
    void ffc88f(ActionEvent event) {

    }

    @FXML
    void onCheckMore_news(ActionEvent event) {

    }

    @FXML
    void onCheckMore_announcements(ActionEvent event) {

    }

    @FXML
    void onCheckMenu_main(ActionEvent event) {

    }

    @FXML
    void onCheckMenu_person(ActionEvent event) {
//        Manager_personal_information_show application = new Manager_personal_information_show();
//        BaseUtil.hideGoPage(stage, application, application.stage);
    }

    @FXML
    void onCheckMenu_join(ActionEvent event) {

    }

    @FXML
    void onCheckMenu_join_users(ActionEvent event) {
        Manager_control_user_show app = new Manager_control_user_show();
        BaseUtil.hideGoPage(stage, app, app.stage);
    }

    @FXML
    void onCheckMenu_join_competitons(ActionEvent event) {
        Manager_control_competition_show app = new Manager_control_competition_show();
        BaseUtil.hideGoPage(stage, app, app.stage);
    }

    @FXML
    void onCheckMenu_scores(ActionEvent event) {
//        Athlete_scores_show application = new Athlete_scores_show();
//        BaseUtil.hideGoPage(stage, application, application.stage);
    }

    @FXML
    void onCheckMenu_informations(ActionEvent event) {
//        Manager_information_show application = new Manager_information_show();
//        BaseUtil.hideGoPage(stage, application, application.stage);
    }

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        init();

    }


    @Override
    public void init() {
        Label main = new Label("首页");
        Label person = new Label("个人信息");
        Label scores = new Label("成绩管理");
        Label info = new Label("信息发布");
        main.setOnMouseClicked(event -> {
            Manager_main_show application = new Manager_main_show();
            BaseUtil.hideGoPage(stage, application, application.stage);
        });
        person.setOnMouseClicked(event -> {
            Manager_personal_information_show application = new Manager_personal_information_show();
            BaseUtil.hideGoPage(stage, application, application.stage);
        });
        scores.setOnMouseClicked(event -> {
            Manager_control_user_show application = new Manager_control_user_show();
            BaseUtil.hideGoPage(stage, application, application.stage);
        });
        info.setOnMouseClicked(event -> {
            Manager_information_show application = new Manager_information_show();
            BaseUtil.hideGoPage(stage, application, application.stage);
        });

        //将标签设置到menu的graphic属性当中
        menu_main.setGraphic(main);
        menu_person.setGraphic(person);
        menu_scores.setGraphic(scores);
        menu_informations.setGraphic(info);
        initShow();
    }

    private void initShow() {
        Manager loginUser = Global.loginAdmin;
        showIdcard.setText(loginUser.getIdCard());
        showUserName.setText(loginUser.getUserName());
        showMobile.setText(loginUser.getTelNumber());
        showRealName.setText(loginUser.getRealName());

    }
}
